package flc.ast.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.stark.picselect.entity.SelectMediaEntity;

import flc.ast.R;
import flc.ast.bean.FormatBean;
import stark.common.basic.adaptermutil.StkEmptyProvider;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;

public class FormatAdapter extends StkProviderMultiAdapter<FormatBean> {

    public FormatAdapter() {
        addItemProvider(new StkEmptyProvider<>(112));
        addItemProvider(new FormatProvider());
    }

    private class FormatProvider extends BaseItemProvider<FormatBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_format;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, FormatBean bean) {
            baseViewHolder.setText(R.id.tvDialogFormatItem,bean.getStr());
            if (bean.isSelect()){
                baseViewHolder.setBackgroundResource(R.id.tvDialogFormatItem,R.drawable.shape_import);
            }else{
                baseViewHolder.setBackgroundResource(R.id.tvDialogFormatItem,0);
            }
        }
    }

}
